<!--
 * @Description: file content
-->
<template>
  <div class="about">
    <el-carousel
      v-if="list.length"
      height="calc(100vh - 59px)"
      direction="vertical"
      :autoplay="false"
    >
      <el-carousel-item v-for="item in list" :key="item._id">
        <div class="item" :style="{ backgroundImage: `url(${BASE_URL + item.productImg})` }">
          <el-card class="box-card">
            <template #header>
              <div class="card-header">
                <h2>{{ item.title }}</h2>
              </div>
            </template>
            <div>{{ item.introduction }}</div>
            <div class="detail">{{ item.detail }}</div>
          </el-card>
        </div>
      </el-carousel-item>
    </el-carousel>
    <el-empty v-else description="暂无数据"></el-empty>
  </div>
</template>
,
<script setup>
import { onMounted, ref } from 'vue'
import axios from 'axios'
import { BASE_URL } from '@public/index.js'

const list = ref([])

onMounted(async () => {
  const res = await axios.get('/webApi/product/list')
  list.value = res.data.data
})
</script>
<style>
.item {
  width: 100%;
  height: 100%;
  background-size: cover;
}
.box-card{
  width: 50%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  .detail{
    margin-top: 20px;
  }
}
</style>
